package com.xmg.p2p.base.service.impl;

import com.xmg.p2p.base.mapper.IplogMapper;
import com.xmg.p2p.base.query.IplogQueryObject;
import com.xmg.p2p.base.query.PageResult;
import com.xmg.p2p.base.service.IIplogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class IplogServiceImpl implements IIplogService{
    @Autowired
    private IplogMapper iplogMapper;
    @Override
    public PageResult query(IplogQueryObject qo) {
        int count = iplogMapper.queryCount(qo);
        if(count>0){
            return new PageResult(iplogMapper.query(qo),count,qo.getCurrentPage(),qo.getPageSize());
        }
        return PageResult.empty(qo.getPageSize());
    }
}
